<%--
  Created by IntelliJ IDEA.
  User: User
  Date: 2024/9/4
  Time: 14:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="<%=request.getContextPath()%>/js/jquery.min.js"></script>
    <script>
        $(function(){
            $("img").click(function(){
                console.log(111)
                $(this).attr("src","<%=request.getContextPath()%>/show.code?id="+new Date().getTime());
            });
        });
    </script>
</head>
<body>
<a href="<%=request.getContextPath()%>/session/register.jsp">返回注册</a>
    <form action="<%=request.getContextPath()%>/login.code">
        用户名: <input type="text" name="username"> <br>
        密码: <input type="password" name="password"> <br>
        验证码: <input type="text" name="code">
        <img src="<%=request.getContextPath()%>/show.code" alt="验证码加载失败">
        <br>
        <input type="submit" value="提交">
        <span style="color:red;">
            <%
                String loginMsg= (String) request.getAttribute("loginMsg");
                if(null!=loginMsg){
                    out.print(loginMsg);
                }
            %>
        </span>
    </form>
</body>
</html>
